package net.ojbk.study.twobox.beans.form.query;

import net.ojbk.study.twobox.beans.form.InputItem;
import net.ojbk.study.twobox.beans.po.Student;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: twobox
 * Date: 2019/4/16
 * Time: 11:42
 * Description: No Description
 */
@Component
public class StudentQueryForm extends SupperQueryForm<Student> {
    private InputItem inputItemClass = new InputItem("班级",
            "classid",
            "", "select", null);

    public StudentQueryForm() {
        // 学生姓名 stuname
        this.inputItems.add(
                new InputItem("学生姓名",
                        "stuname",
                        "", "text")
        );
        // 班级 classid
        this.inputItems.add(inputItemClass);
    }

    @Override
    public List<InputItem> getInputItems() throws Exception {
        this.inputItemClass.setOther(this.selectOptionUtil.getSelectOptionListByName("class"));
        return super.getInputItems();
    }
}
